package com.hm.add1;

import java.util.ArrayList;
import java.util.Collections;

public class Test {
    public static void main(String[] args) {
        DingZhen dz = new DingZhen();
        SnowLeopard snowLeopard = new SnowLeopard();
        Relic relic = new Relic();
        Animal animal1 = new Animal();
        RoeDeer roeDeer = new RoeDeer();
        ArrayList<Animal> list = new ArrayList<>();
        Collections.addAll(list,snowLeopard,relic,roeDeer,animal1);
        for (Animal animal : list) {
            dz.listen(animal);
        }
    }
}
